﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="ViewOrderByUser.aspx.cs" Inherits="Order_ViewOrderByUser" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CPH_Main" runat="Server">
    <table>
        <tr>
            <td>
                <asp:DropDownList ID="dpl_User" runat="server" AutoPostBack="True" DataSourceID="ADS_User"
                    DataTextField="U_sName" DataValueField="U_nID">
                </asp:DropDownList></td>
        </tr>
        <tr>
            <td>
                <asp:GridView ID="gdv_OrderByUser" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" AutoGenerateColumns="False" DataSourceID="ADS_OrderByUser">
                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <RowStyle BackColor="#EFF3FB" />
                    <EditRowStyle BackColor="#2461BF" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <AlternatingRowStyle BackColor="White" />
                    <Columns>
                        <asp:BoundField DataField="ord_nID" HeaderText="订单号" InsertVisible="False" SortExpression="ord_nID" />
                        <asp:BoundField DataField="R_sName" HeaderText="餐馆名" SortExpression="R_sName" />
                        <asp:BoundField DataField="ord_dtArrivalTime" HeaderText="订餐时间" SortExpression="ord_dtArrivalTime" />
                        <asp:BoundField DataField="ord_nTableNum" HeaderText="桌位数" SortExpression="ord_nTableNum" />
                        <asp:BoundField DataField="ord_sDesc" HeaderText="要求" SortExpression="ord_sDesc" />
                        <asp:BoundField DataField="ord_dtBookTime" HeaderText="下订单时间" SortExpression="ord_dtBookTime" />
                    </Columns>
                </asp:GridView>
            </td>
        </tr>
    </table>
    <asp:AccessDataSource ID="ADS_OrderByUser" runat="server" DataFile="~/App_Data/DB_NCI5.mdb" SelectCommand="SELECT OrderRecord.ord_dtBookTime, OrderRecord.ord_dtArrivalTime, OrderRecord.ord_nID, OrderRecord.ord_nTableNum, OrderRecord.ord_sDesc, Restaurant.R_sName FROM (OrderRecord INNER JOIN Restaurant ON OrderRecord.ord_nState = Restaurant.R_nID) WHERE (OrderRecord.ord_nUserID = ?)">
        <SelectParameters>
            <asp:ControlParameter ControlID="dpl_User" Name="?" PropertyName="SelectedValue" />
        </SelectParameters>
    </asp:AccessDataSource>
    <asp:AccessDataSource ID="ADS_User" runat="server" DataFile="~/App_Data/DB_NCI5.mdb" SelectCommand="SELECT [U_nID], [U_sName] FROM [User] WHERE ([U_nRole] = ?)">
        <SelectParameters>
            <asp:Parameter DefaultValue="0" Name="U_nRole" Type="String" />
        </SelectParameters>
    </asp:AccessDataSource>
</asp:Content>
